package com.haixiaoke.saas.contract.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.haixiaoke.saas.bill.domain.HouseBill;
import com.haixiaoke.saas.bill.domain.HouseBillItemMerge;
import com.haixiaoke.saas.common.annotation.Excel;
import com.haixiaoke.saas.common.core.domain.BaseEntity;
import com.haixiaoke.saas.order.domain.Order;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 租客合同对象 biz_lessee_contract
 *
 * @author panda
 * @date 2024-06-04
 */
@Data
public class LesseeContract extends BaseEntity {
    private static final long serialVersionUID = 1L;


    /**
     * 合同id
     */
    private String lesseeContractId;

    /**
     * 房屋id
     */
    @Excel(name = "房屋id")
    private String houseId;

    /**
     * 订单id
     */
    @Excel(name = "订单id")
    private String orderId;

    /**
     * 租户id
     */
    @Excel(name = "租户id")
    private String tenantId;

    /**
     * 合同状态:1.待确认;2.签署中;3.签署完成;4.已终止;5.已逾期
     */
    @Excel(name = "合同状态:1.待确认;2.签署中;3.签署完成;4.已终止;5.已逾期")
    private String lesseeContractStatus;

    /**
     * 承租方式:1.个人;2.企业
     */
    @Excel(name = "承租方式:1.个人;2.企业")
    private String lesseeType;

    /**
     * 业主id
     */
    @Excel(name = "业主id")
    private Long proprietorUserId;

    /**
     * 乙方id
     */
    @Excel(name = "乙方id")
    private Long conUserId;

    /**
     * 联系人姓名
     */
    @NotBlank(message = "联系人姓名不能为空")
    @Excel(name = "联系人姓名")
    private String contactName;

    /**
     * 联系人手机号
     */
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @Excel(name = "联系人手机号")
    private String contactPhone;

    /**
     * 身份证号
     */
    @Excel(name = "身份证号")
    private String cardNumber;

    /**
     * 企业名称
     */
    @Excel(name = "企业名称")
    private String enterpriseName;

    /**
     * 社会统一信用代码
     */
    @Excel(name = "社会统一信用代码")
    private String socialCreditCode;

    /**
     * 签署方式:1.平台与租客签约;2.业主与租客签约
     */
    @Excel(name = "签署方式:1.平台与租客签约;2.业主与租客签约")
    private String signingMode;

    /**
     * 合同类型:1.个人纸质合同;2.企业纸质合同;3.个人电子合同;
     */
    @Excel(name = "合同类型:1.个人纸质合同;2.企业纸质合同;3.个人电子合同;")
    private String contractType;

    /**
     * 合同流程id
     */
    @Excel(name = "合同流程id")
    private String flowId;

    /**
     * 合同模板id
     */
    @Excel(name = "合同模板id")
    private String contractTemplateId;

    /**
     * 模板名称
     */
    @Excel(name = "模板名称")
    private String contractTemplateName;

    /**
     * 合同内容
     */
    @Excel(name = "合同内容")
    private String contractContent;

    /**
     * 合同模板内容
     */
    @Excel(name = "合同模板内容")
    private String templateContent;

    /**
     * 合同编号
     */
    @Excel(name = "合同编号")
    private String contractNumber;

    /**
     * 合同扫描件
     */
    @Excel(name = "合同扫描件")
    private String contractScanning;

    /**
     * 合同图片
     */
    @Excel(name = "合同图片")
    private String contractImage;

    /**
     * 补充条款
     */
    @Excel(name = "补充条款")
    private String supplementaryTerms;

    /**
     * 签约人id
     */
    @Excel(name = "签约人id")
    private Long busUserId;

    /**
     * 签约人
     */
    @Excel(name = "签约人")
    private String signer;

    /**
     * 签约时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "签约时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date signingTime;

    /**
     * 最晚签约时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最晚签约时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date latestSigningTime;

    /**
     * 租客来源
     */
    @Excel(name = "租客来源")
    private Long lesseeSourceId;
    private String lesseeSourceName;

    /**
     * 水表读数
     */
    @Excel(name = "水表读数")
    private BigDecimal waterMeterReading;

    /**
     * 电表读数
     */
    @Excel(name = "电表读数")
    private BigDecimal electricityMeterReading;

    /**
     * 甲方签署标识(0,没签,1.已签)
     */
    private String partyASignFlag;

    /**
     * 乙方签署标签(0,没签,1.已签)
     */
    private String partyBSignFlag;

    /**
     * 显示状态(0.显示,1.隐藏)
     */
    private String showState;

    /**
     * 逻辑删除标志(0代表存在
     */
    private String delFlag;

    /**
     * 入住时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date checkInTime;

    /**
     * 退房时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date checkOutTime;

    /**
     * 小区地址
     */
    private String premisesAddress;

    private Order order;

    /**
     * 房屋账单加收费用集合
     */
    private List<HouseBillItemMerge> houseBillItemMergeList;

    /**
     * 房屋账单集合
     */
    private List<HouseBill> houseBillList;

    /**
     * 房屋设施集合
     */
    private List<ContractFacilitiesItem> contractFacilitiesItemList;

    /**
     * 合同扫描件集合
     */
    private List<String> contractScanningList;

    /**
     * 合同图片集合
     */
    private List<String> contractImageList;

    /**
     * 合同类型集合:1.个人纸质合同;2.企业纸质合同;3.个人电子合同;
     */
    private List<String> contractTypeList;

    /**
     * 重定向url
     */
    private String redirectUrl;

    /**
     * 违约金生成状态: 1不收取 2收取:
     */
    private String penaltyStates;

    /**
     * 违约金比例
     */
    private BigDecimal penaltyScale;
}
